Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

132
Vistas
Javascript input form | display "creating... " and refresh page

Below I have script js and form.

$(document).on('submit','#form_create_user',function(e){
    e.preventDefault();
    var fd = new FormData(this);
    var obj = $(this);
    fd.append('course_id', "<?php echo $this->uri->segment(4); ?>");
    obj.find('input[type="submit"]').val("Creating...")
    $.ajax({
        url: $(this).attr("action"),
        data: fd,
        cache: false,
        processData: false,
        contentType: false,
        type: 'POST',
        success: function (dataofconfirm) {
            // do something with the result
           // obj.find('input[type="submit"]').val("Confirm")
        }
    });
    $.ajax({
        url: "<?php echo site_url('home/saveValues/'); ?>",
        data: fd,
        cache: false,
        processData: false,
        contentType: false,
        type: 'POST',
        success: function (dataofconfirm) {
            // do something with the result
            toastr.success("Success created user.");
            obj.find('input[type="submit"]').val("Confirm")
        }
    });
  })
<form action="?" method="post" name="form_create_user" id="form_create_user">
      <input name="username" type="text" id="username" value="test"><input type="submit" name="Submit" value="Confirm">
</form>

When I click on submit form then this script change text on button from "create" to "creating..." and display success action. But now this take about 1sec.

I need extand this script and I need: display "creating..." for one minute and then return a success action.

note: the script run by form I need to set to run immediately, but only return success after a minute and reload the page.

Can anyone help me?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda